home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / superopt.zip / INSN.DEF < prev    next >
Text File  |  1992-11-21  |  5KB  |  154 lines

  1. /* This file contains the definitions and documentation for the instructions
  2.    used in the Superoptimizer.
  3.  
  4.    Copyright (C) 1992 Free Software Foundation, Inc.
  5.  
  6.    This program is free software; you can redistribute it and/or modify it
  7.    under the terms of the GNU General Public License as published by the
  8.    Free Software Foundation; either version 2, or (at your option) any
  9.    later version.
  10.  
  11.    This program is distributed in the hope that it will be useful, but
  12.    WITHOUT ANY WARRANTY; without even the implied warranty of
  13.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.    General Public License for more details.
  15.  
  16.    You should have received a copy of the GNU General Public License along
  17.    with this program; see the file COPYING.  If not, write to the Free
  18.    Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. /* The fields in the cpp macro call "DEF_INSN()" are:
  21.  
  22.    1. The internal name of the instruction.
  23.  
  24.    2. The class of the instruction.  These are stored in the insn_class
  25.    array and are accessed via the GET_INSN_CLASS macro.  They are defined
  26.    as  follows:
  27.  
  28.      "1" an rtx code for a unary arithmetic expression (e.g, ABSVAL, CLZ)
  29.      "c" an rtx code for a commutative binary operation (e.g,  ADD, XOR)
  30.      "2" an rtx code for a non-commutative binary operation (e.g., SUB, CMP)
  31.      "x" everything else
  32.  
  33.    3. The printed name of the instruction.
  34.  
  35.    */
  36.  
  37. /* Arithmetic insns.  d = r1 + r2 [+ cy] */
  38. DEF_INSN (ADD,            'b', "add")
  39. DEF_INSN (ADD_CI,         'b', "add_ci")
  40. DEF_INSN (ADD_CO,         'b', "add_co")
  41. DEF_INSN (ADD_CIO,        'b', "add_cio")
  42. /* Arithmetic insns.  d = r1 - r2 [- cy] */
  43. DEF_INSN (SUB,            '2', "sub")
  44. DEF_INSN (SUB_CI,         '2', "sub_ci")
  45. DEF_INSN (SUB_CO,         '2', "sub_co")
  46. DEF_INSN (SUB_CIO,        '2', "sub_cio")
  47. /* Arithmetic insns.  d = r1 + ~r2 [+ cy] */
  48. DEF_INSN (ADC_CI,         '2', "adc_ci")
  49. DEF_INSN (ADC_CO,         '2', "adc_co")
  50. DEF_INSN (ADC_CIO,        '2', "adc_cio")
  51.  
  52. /* Logical insns that don't affect the carry flag.  */
  53. DEF_INSN (AND,            'b', "and")
  54. DEF_INSN (IOR,            'b', "ior")
  55. DEF_INSN (XOR,            'b', "xor")
  56. DEF_INSN (ANDC,           '2', "andc")
  57. DEF_INSN (IORC,           '2', "iorc")
  58. DEF_INSN (EQV,            '2', "eqv")
  59. DEF_INSN (NAND,           'b', "nand")
  60. DEF_INSN (NOR,            'b', "nor")
  61.  
  62. /* Logical insns that reset the carry flag.  */
  63. DEF_INSN (AND_RC,         'b', "and_rc")
  64. DEF_INSN (IOR_RC,         'b', "ior_rc")
  65. DEF_INSN (XOR_RC,         'b', "xor_rc")
  66. DEF_INSN (ANDC_RC,        '2', "andc_rc")
  67. DEF_INSN (IORC_RC,        '2', "iorc_rc")
  68. DEF_INSN (EQV_RC,         '2', "eqv_rc")
  69. DEF_INSN (NAND_RC,        'b', "nand_rc")
  70. DEF_INSN (NOR_RC,         'b', "nor_rc")
  71.  
  72. /* Logical insns that clobber the carry flag.  */
  73. DEF_INSN (AND_CC,         'b', "and_cc")
  74. DEF_INSN (IOR_CC,         'b', "ior_cc")
  75. DEF_INSN (XOR_CC,         'b', "xor_cc")
  76. DEF_INSN (ANDC_CC,        '2', "andc_cc")
  77. DEF_INSN (IORC_CC,        '2', "iorc_cc")
  78. DEF_INSN (EQV_CC,         '2', "eqv_cc")
  79. DEF_INSN (NAND_CC,        'b', "nand_cc")
  80. DEF_INSN (NOR_CC,         'b', "nor_cc")
  81.  
  82. /* Bit shift and count.  */
  83. DEF_INSN (LSHIFTR,        '2', "log_shift_right")
  84. DEF_INSN (ASHIFTR,        '2', "arith_shift_right")
  85. DEF_INSN (SHIFTL,         '2', "shift_left")
  86. DEF_INSN (LSHIFTR_CO,     '2', "log_shift_right_co")
  87. DEF_INSN (ASHIFTR_CO,     '2', "arith_shift_right_co")
  88. DEF_INSN (SHIFTL_CO,      '2', "shift_left_co")
  89. DEF_INSN (ROTATEL,        '2', "rotate_left")
  90. DEF_INSN (ROTATEL_CO,     '2', "rotate_left_co")
  91.  
  92. /* Rotate thru carry.  */
  93. DEF_INSN (ROTATEXL_CIO,   '2', "rotate_thru_carry_left_co")
  94.  
  95. /* Shift arithmetic right instruction and set carry iff the shifted
  96.    operand is negative and any bit shifted out is 1.  */
  97. DEF_INSN (ASHIFTR_CON,    '2', "arith_shift_right_set_carry_if_neg_and_nzbit_lost")
  98.  
  99. /* Extract.  */
  100. DEF_INSN (EXTS1,          '2', "exts1")
  101. DEF_INSN (EXTS2,          '2', "exts2")
  102. DEF_INSN (EXTU1,          '2', "extu1")
  103. DEF_INSN (EXTU2,          '2', "extu2")
  104.  
  105. /* Count leading/trailing zero instructions.  */
  106. DEF_INSN (CLZ,            '1', "clz")
  107. DEF_INSN (CTZ,            '1', "ctz")
  108. DEF_INSN (FF1,            '1', "ff1")
  109. DEF_INSN (FF0,            '1', "ff0")
  110.  
  111. DEF_INSN (ABSVAL,         '1', "abs")
  112. DEF_INSN (NABSVAL,        '1', "nabs")
  113. DEF_INSN (CMP,            '2', "cmp")
  114.  
  115. /* 29k CMP instructions.  */
  116. DEF_INSN (CPEQ,           '2', "cpeq")
  117. DEF_INSN (CPGE,           '2', "cpge")
  118. DEF_INSN (CPGEU,          '2', "cpgeu")
  119. DEF_INSN (CPGT,           '2', "cpgt")
  120. DEF_INSN (CPGTU,          '2', "cpgtu")
  121. DEF_INSN (CPLE,           '2', "cple")
  122. DEF_INSN (CPLEU,          '2', "cpleu")
  123. DEF_INSN (CPLT,           '2', "cplt")
  124. DEF_INSN (CPLTU,          '2', "cpltu")
  125. DEF_INSN (CPNEQ,          '2', "cpneq")
  126.  
  127. /* 88100 cmp instruction.  */
  128. DEF_INSN (CMPPAR,         '2', "cmppar")
  129.  
  130. /* Difference-or-zero (rs6000) */
  131. DEF_INSN (DOZ,            '2', "difference_or_zero")
  132.  
  133. DEF_INSN (COPY,           '1', "copy")
  134. DEF_INSN (EXCHANGE,       '2', "exchange")
  135.  
  136. /* Complement carry */
  137. DEF_INSN (COMCY,          '2', "complement_cy")
  138.  
  139. DEF_INSN (INVDIV,         '2', "invdiv")
  140. DEF_INSN (INVMOD,         '2', "invmod")
  141. DEF_INSN (UMULWIDEN_HI,   '2', "umulwiden_hi")
  142. DEF_INSN (MUL,            '2', "mul")
  143.  
  144. #if UDIV_WITH_SDIV
  145. DEF_INSN (SDIV,           '2', "sdiv")
  146. #endif
  147.  
  148. /*
  149. Local variables:
  150. mode:c
  151. version-control: t
  152. End:
  153. */
  154.